package cn.hongwei.factorybean;

import org.springframework.beans.factory.SmartFactoryBean;
import org.springframework.stereotype.Component;

/**
 * @author Great
 * @email 1224028994@qq.com
 */
@Component
public class MySmart implements SmartFactoryBean<UserDao> {
    @Override
    public UserDao getObject() throws Exception {
        return new UserDao();
    }

    @Override
    public Class<?> getObjectType() {
        return UserDao.class;
    }

    //一定要重新这个方法,返回true表示立即加载
    @Override
    public boolean isEagerInit() {
        return true;
    }
}
